import Vue from 'vue';
import App from './App';

// 数据管理
import store from '@/store';
Vue.prototype.$store = store;

// 全局混入
import global from './mixins/global.js';
Vue.mixin(global);

// 方法集合
import utils from './utils';
Object.keys(utils).forEach(key => {
    Vue.prototype[`$${key}`] = utils[key];
});

// 过滤器
import filters from './filters';
Object.keys(filters).forEach(key => {
    Vue.filter(key, filters[key]);
});

import uView from '@/uni_modules/uview-ui'
Vue.use(uView);
uni.$u.config.unit = 'rpx';

Vue.config.productionTip = false
App.mpType = 'app'

const app = new Vue({
    ...App,
    store
});

// 注册请求拦截器
import interceptor from './request/interceptor.js';
Vue.use(interceptor, app);

// 注册api接口
import api from './request/api.js';
Vue.use(api, app);

app.$mount();
